﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class Admin_adminpostjobs : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            fillEmployer();
        }
    }
    public void fillEmployer()
    {
        DataSet DsetEmployer = new DataSet();
        JobSiteStarterKit.DAL.DBAccess obj=new JobSiteStarterKit.DAL.DBAccess();
        DsetEmployer = obj.ExecuteDataSet("Proc_GetCompanyDetails");
        if (DsetEmployer.Tables.Count > 0)
        {
            if (DsetEmployer.Tables[0].Rows.Count > 0)
            {
                DgridPostjobs.DataSource = DsetEmployer.Tables[0].DefaultView;
                DgridPostjobs.DataBind();
            }
        }
    }
    protected void DgridPostjobs_SelectedIndexChanged(object sender, EventArgs e)
    {

        string username = DgridPostjobs.SelectedDataKey.Value.ToString();
        string pwd = "";
        MembershipUserCollection col = Membership.FindUsersByName(username);
        pwd = col[username].GetPassword();
        JobSiteStarterKit.BOL.Common.Login_Validation(username, pwd, this.Page, true, new bool[] { true });
        Response.Redirect("../employer/default.aspx");

        //string username = String.Empty;
        //string pwd = String.Empty;
        //if (Session["AdminUid"] != null)
        //{
        //    username = Convert.ToString(Session["AdminUid"]);
        //}
        //if (Session["AdminPass"] != null)
        //{
        //    pwd = Convert.ToString(Session["AdminPass"]);
        //}
        //if (username != "" && pwd != "")
        //{
        //    JobSiteStarterKit.BOL.Common.Login_Validation(username, pwd, this.Page, true, new bool[] { true });
        //    Response.Redirect("../employer/default.aspx");
        //}

    }
    protected void DgridPostjobs_RowCommand(object sender, GridViewCommandEventArgs e)
    {

    }
}
